package model;

import java.io.File;

/**
 * An object to represent a file associated with the recommendation of a paper.
 * @author Kevin Anderson
 */
public class Review extends Paper {

	/**
	 * Value of the ID associated with this review.
	 */
	private int my_id;
	
	/**
	 * Value of the ID of the paper associated with this review.
	 */
	private int my_paperID;
	
	/**
	 * Value of the ID of the reviewer who submitted this review.
	 */
	private int my_reviewerID;
	
	/**
	 * The local file path of the review on the file system.
	 */
	private String my_path;
	
	/**
	 * Constructs a new Review.
	 * @param id The ID of the Review.
	 * @param paperID The ID of the Paper associated with this review.
	 * @param reviewerID The ID of the Reviewer who submitted
	 * @param path
	 */
	public Review(int id, int paperID, int reviewerID, String path)
	{
		my_id = id;
		my_paperID = paperID;
		my_reviewerID = reviewerID;
		my_path = path;
		if(!makeFile())
			System.err.println("Review failed to make a file!");
	}
	
	/**
	 * Constructs a {@link File} object using the recommendations file path.
	 * @return <code>true</code>If the file is successfully construted, <code>false</code> otherwise.
	 */	
	public boolean makeFile()
	{
		my_file = new File(my_path);
		if (my_file == null)
			return false;	
		
		return true;
	}

	
	/**
	 * @return The Value of the ID associated with the review.
	 */
	public int getMy_id()
	{
		return my_id;
	}
	
	/**
	 * @return The Value of the ID of the paper associated with the review.
	 */	
	public int getMy_paperID()
	{
		return my_paperID;
	}
	
	/**
	 * @return The Value of the ID associated with the user who submitted the review..
	 */
	public int getMy_reviewerID()
	{
		return my_reviewerID;
	}
	
	/**
	 * @return The path of the file on the local file system.
	 */
	public String getMy_path()
	{
		return my_path;
	}
	
	/**
	 * {@inheritDoc}
	 */
	@Override
	public String toString()
	{
		return "ReviewID: " + my_id;
	}
	
	
	
}